package de.koller.cell.client;

import de.koller.aframe.plain.ADisplayPlain;
import de.koller.aframe.plain.IARootPlain;
import de.koller.aframe.util.resource.SpriteTileGen;
import de.koller.cell.CNode;
import de.koller.cell.CellStart;
import de.koller.cell.client.input.CInput;
import de.koller.cell.client.visual.VisualRoot;
import de.koller.oceanFramework.tree.Child;
import java.awt.Graphics2D;

public class CClient extends CNode implements IARootPlain {
	
	@Child public final VisualRoot visual = new VisualRoot();
	public final ADisplayPlain display = new ADisplayPlain( this, CellStart.WIDTH, CellStart.HEIGHT, CellStart.TITLE );
	public SpriteTileGen tileTextures;
	@Child public final CInput input = new CInput();

	@Override
	protected void init() {
		super.init();
		
		display.clearScreen = false;
		display.init();
	
		tileTextures =  SpriteTileGen.create( "./resource/textures.png", 
											  "./resource/texture.config",
											  display.getGraphicsConfiguration() );
	}

	@Override
	protected void release() {
		super.release();
		
		display.release();
	}
	
	@Override
	public void displayClosed() {
		croot.stopRoot();
	}

	@Override
	public void render( Graphics2D g ) {

	}

	@Override
	public long getSystemTime() {
		return croot.getSystemTime();
	}
	
}
